<template>
  <div class="registerSuccessView">
    <strong>注册成功您的账号是：{{ account }}</strong>
    <el-button @click="copyAndToView">复制账号并前往登录</el-button>
  </div>
</template>

<script setup lang="ts">
import { copyToBoard, toView } from "@/utils/utils";

const route = useRoute();
let account = route.query.account;

const copyAndToView = async (): Promise<void> => {
  let copyResult = await copyToBoard(String(account));
  if (!copyResult) {
    return;
  }
  toView("Login", null, { account });
};

</script>

<style scoped lang="less">
.registerView {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;

  strong {
    margin: 10px 0;
    font-size: 20px;
  }

  :deep(input) {
    margin-bottom: 20px;
  }
}
</style>
